@model Lens.com.Models.PhotoGalleryViewModels
@{   
    var imagepath = (string)TempData["ViewImageUrl"];
    Layout = "~/Views/Shared/_Layout_M.cshtml";
}
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style type="text/css">
    .ReportTable td
    {
        border: 1px solid #555;
        border-spacing: 5px;
    }

    #btnPost
    {
        
        background-image: url(@Url.Content("~/Content/images/post.png"));
        background-position: 0px 0px;
        background-repeat: no-repeat;
        width: 76px;
        height: 21px;
        border: 0px;
        cursor: pointer;
        color: transparent;
        background-color: transparent;
    }

    #btnShare
    {
        background-image: url(@Url.Content("~/Content/images/share.png"));
        background-position: 0px 0px;
        background-repeat: no-repeat;
        width: 76px;
        height: 21px;
        border: 0px;
        color: transparent;
        cursor: pointer;
        background-color: transparent;
    }

    #btnPrev
    {    
        background-image: url(@Url.Content("~/Content/images/Previous_1.png"));
        background-position: 0px 0px;
        background-repeat: no-repeat;
        width: 24px;
        height: 24px;
        border: 0px;
        cursor: pointer;
        color: transparent;
        background-color: transparent;
    }

    #btnNext
    {    
        background-image: url(@Url.Content("~/Content/images/Next_1.png"));
        background-position: 0px 0px;
        background-repeat: no-repeat;
        width: 24px;
        height: 24px;
        border: 0px;
        cursor: pointer;
        color: transparent;
        background-color: transparent;
    }

    #btnUpload
    {
   
        background-image: url( @Url.Content("~/Content/images/audioupload.png"));
        background-position: 0px 0px;
        background-repeat: no-repeat;
        width: 40px;
        height: 36px;
        border: 0px;
        cursor: pointer;
        background-color: transparent;
        color: transparent;
    }
</style>

<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link href="css/header_styles.css" rel="stylesheet" type="text/css" />
<link href="css/button_styles.css" rel="stylesheet" type="text/css" />
<link href="css/highslide.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/CSS/solved_issues.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/CSS/specialist_page.css")" rel="stylesheet" type="text/css" />
<script src="~/Scripts/JSforValidations.js" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/ddpowerzoomer.js")">

/***********************************************
* Image Power Zoomer- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<script type="text/javascript">   
    window.history.forward()
    jQuery(document).ready(function ($) { //fire on DOM ready

        /*
        EXAMPLE 1:
        $('#myimage').addpowerzoom()
    
        EXAMPLE 2:
        $('img.vacation').addpowerzoom({
            defaultpower: 2,
            powerrange: [2,5],
            largeimage: null,
            magnifiersize: [100,100] //<--no comma following last option!
        })
        */

    })
    jQuery(document).ready(function() {
        jQuery("#divplayer").click(function(){
            jQuery("#div1").show("fast");           
        });
    });      
   

</script>

<script type="text/javascript">

function SolutiontextCount()
{
var  msglenth= document.getElementById('AddSolution').value ;
 document.getElementById('lbltxtcount').innerHTML =(500- msglenth.length);
if(msglenth.length>500)
{
return false;
}
}

    jQuery(function () {
        jQuery("#accordion").accordion({
            collapsible: true
        });
    });

    jQuery(function () {
        jQuery("#accordion1").accordion({
            collapsible: true
        });
    });

    jQuery(function () {
        jQuery('#btnShare').click(function () {  
            if(document.getElementById('txtMobileNo').value=='')
            {
                var checkboxes = jQuery(this).closest('form').find(':checkbox');
                for (var i = 0; i < checkboxes.length; i++) {
                    if (checkboxes[i].checked)
                        return true;
                }
                alert("Please enter mobile Number or select at least one group");
                return false;               
            }           
        });
    });


    
</script>

<script type="text/javascript">
    jQuery(document).ready(function ($) { //fire on DOM ready
        $('#imgpop').addpowerzoom()
        return false;
    })
</script>

<script type="text/javascript" src="~/Scripts/JSforValidations.js">
  
   
    //need to handle more cases like ctrl+R whose codes are not listed here
    //document.onkeydown = checkKeycode
 
</script>


@using (Html.BeginForm("Upload", "PhotoGalleryView", FormMethod.Post, new { enctype = "multipart/form-data", Model }))
{
    TempData["ReportId"] = Model.ProblemId;    
    <div id="problems">

        <div id="specialist_heading_bg_float_space">
            <div id="specialist_heading_bg_float">
                <img src="~/Content/images/home_heading_bg_left.png" alt="" />
            </div>
            <div>@Html.Hidden("HiddenReportID", Model.ProblemId)</div>
            <div id="specialist_heading_bg">
                <div id="specialist_text">Lense Info</div>
                <div id="specialist_more_text">Posted on: @Model.ReportedDate</div>
            </div>

            <div id="specialist_heading_bg_float">
                <img src="~/Content/images/home_heading_bg_right.png" alt="" />
            </div>
        </div>
        <div id="clear"></div>
        <div style="margin-left: 4px; margin-right: 4px;">
            <div id="networkBar">

                <div id="networkBarPopup" style="overflow: visible; display: none;">
                    <div style="bottom: 70px;" id="networkBarBanners">

                        <div id="login_space">
                            <div id="user_name">
                                <input type="text" id="username" value="User ID" size="20" />
                            </div>
                            <div id="password">
                                <input type="password" id="username" value="Enter Password" size="20" />
                            </div>
                            <div id="login_img">Go!</div>
                            <div id="register_img">Register</div>
                            <div id="forgot_password">Forgot Password</div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </div>
        <div>
            <div>
                <table width="100%">
                    <tr>
                        <td class="btns_left_arrow">
                            <input id="btnPrev" type="button" value="Prev" name="Command"   onclick="window.location.href='@Url.Action("GetPagingImage", new { id = Model.ProblemId, Flag = "P" })    '" title="Previous image" />
                        </td>
                        <td class="btns_right_arrow">
                            <input id="btnNext" type="button" value="Next" name="Command"  onclick="window.location.href='@Url.Action("GetPagingImage", new { id = Model.ProblemId, Flag = "N" })    '" title="Next image" />
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td>
                            <img src="@Url.Content(@imagepath)" id="imgpop" alt="Image" style="padding-left:15px;padding-top:10px;" cellpadding="6"  class="popup" width="400" height="320" /></td>
                        <td valign="top">
                            <b>
                                <div id="farmer_details_heading">Supporting Info:</div>
                            </b>
                            <table>
                                <tr>
                                    <td>
                                        <table class="ReportTable" style="border: 1px solid lightgrey; margin-left: 20px; border-collapse: collapse;" align="top" cellpadding="6" width="200">
                                            <tr>
                                                <td class="crop_heading">
                                                    @*  @Html.Name("Name")*@
                                                    <label id="Name">Name</label>
                                                </td>
                                                @if (Model.Name != null)
                                                {
                                                    <td>
                                                        <label id="lblNameText">@Model.Name</label>
                                                    </td>
                                                }
                                            </tr>
                                            <tr>
                                                <td>
                                                    @Html.Name("Location")
                                                </td>
                                                <td>
                                                    <label id="lblLocationText">@Model.StateName</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    @Html.Name("Phone")
                                                </td>
                                                <td>
                                                    <label id="lblMobileNoText">@Model.MobileNo</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    @Html.Name("Email")
                                                </td>
                                                <td>
                                                    <label id="lblEmailText">@Model.EmailId</label>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <p></p>
                            @if (Model.ListDynamic.Count > 0)
                            {
                                <table class="reported_class"  margin-left:"20px"; align="top" cellspacing="0" cellpadding="0" width="200">
                                    @foreach (var item in @Model.ListDynamic)
                                    {
                                        if (!string.IsNullOrEmpty(item.AttributeText))
                                        {                      
                                        <tr>
                                            <td class="reported_class_text">

                                                @Html.Name(@item.AttributeName)
                                            </td>
                                            <td class="reported_class_text1">
                                                <label id=@item.AttributeName>@item.AttributeText</label>
                                            </td>
                                        </tr>                       
                                        }
                                    }
                                </table>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 15px; width: 300px;">

                            <table style="empty-cells: hide">
                                <tr>
                                    @foreach (var item in Model.ImageList)
                                    {                
                                        <td>
                                            @*@Html.ActionLink(item.PageNumber.ToString(), "GetImage", "PhotoGalleryView", new { ImgUrl = item.ImageUrl }, new { })
                                             <img src="~/Uploads/1.jpg" style="border-color: silver; border: solid;" alt="Image" class="popup" width="30" height="30" /></a>*@
                                            <a href="@Url.Action("GetImage", "PhotoGalleryView", new { ImgUrl = item.ImageUrl })" >
                                                <img src="@Url.Content(item.ImageUrl)"  style="border-color:silver;border-width:3px;" height="30" width="42" /></a>
                                        </td>            }
                                    @if (!string.IsNullOrEmpty(Model.AudioPath))
                                    {
                                        <td>
                                            <div  id="divplayer" style="background-image: url(@Url.Content("~/Content/images/audio-icon.png")); background-repeat:no-repeat;cursor: pointer;width:32px;height:42px;color: transparent;background-color:transparent;"  onclick="detectQT()"></div>
                                        </td>
                                        <td>
                                            <div id="div1">

                                                @* <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="160"height="10">
    
                                                    <param name="SRC" value="@Url.Content(Model.AudioPath)"/>
                                                    <param name="AUTOPLAY" value="false"/>
                                                    <param name="CONTROLLER" value="true"/>
      
                                                </object>  *@
                                                <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
                                                    width="200" height="15">
                                                    <param name="src" value="@Url.Content(Model.AudioPath)" />
                                                    <param name="autoplay" value="false" />

                                                    <param name="controller" value="true" />
                                                    <!--[if !IE]> <-->
                                                    <object data="@Url.Content(Model.AudioPath)" width="200" height="15" type="video/quicktime" id="audiofile">

                                                        <param name="controller" value="true" />
                                                        <param name="autoplay" value="false" />
                                                    </object>
                                                    <!--> <![endif]-->
                                                </object>
                                            </div>
                                        </td>
                                    }
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table style="margin: 20px;">
                                <tr>
                                    <td>
                                        <input type="file" name="AudioFileUpload" accept="audio/mp3,audio/wave,mp3|.wave"
                                            style="color: ActiveBorder; background: center;" id="Browse" onchange="checkfile(this);" title="please select a .wave or .mp3  file" />
                                        <span style="padding-left: 45px;">
                                            <input type="submit" id="btnUpload" name="Command" value="Audio Upload" onclick="return AudiouploadFile();" title="Maximum of 2 minutes can be recorded" /></span>

                                        @if (!string.IsNullOrEmpty(Convert.ToString(TempData["Audio"])))
                                        {
                                           
@*<b><span id="successMsg" style="color: red">File uploaded successfully</span></b>*@
                                            <script>
                                                alert('@Convert.ToString(TempData["Audio"])');                                                      
                                            </script>                                         
                                        }
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table style="margin: 20px;">
                    <tr>
                        <td class="problem_description_text" colspan="2"><b>Problem Description :</b> @Html.Label("lblObservation", @Model.Observation)</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div id="proposed_solution_bg" style="width: 100%;"></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-top: 10px;">
                            <div>
                                <div>
                                    <div id="proposed_solution_img">
                                        <img src="~/Content/images/proposed_solution.png" alt="" />
                                    </div>
                                    <div id="proposed_solution_heading">PROPOSED SOLUTION:</div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-bottom: 10px;">
                            @Html.TextAreaFor(model => model.AddSolution, new { onpaste = "return false;", @cols = "75", @rows = "4", @maxlength= 500, @Onkeydown = "SolutiontextCount()" })
                    <span> <label for="lbltxtcount" id="lbltxtcount"></label>
                          Characters Left </span> 
                            </td>
                    </tr>                    
                    <tr>
                        <td style="padding-bottom: 20px;">
                            <input type="submit" id="btnPost" name="Command" class="btnPost" value="Post" />
                            @* <input  type="submit"   id="btnShares"  name="Command" class="btnShare"  value="Share" onclick="window.location.href='@Url.Action("PhotoGalleryView", "SaveSolutionDetails", Model)    '"  >*@
                            @if (!string.IsNullOrEmpty(Convert.ToString(TempData["Posted"])))
                            {
                                <script>
                                    alert('@Convert.ToString(TempData["Posted"])');                                                      
                                </script> 
                            }
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <div id="accordion" style="width: 620px">
                                <h1><a href="#">
                                    <div id="previous_solution_heading">Share reported Information</div>
                                </a></h1>
                                <div>
                                    <table>
                                        <tr>
                                            <td>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <label id="lblMobileNo">Mobile No</label>&nbsp;&nbsp;</td>
                                                        <td>
                                                        :&nbsp;&nbsp;@Html.TextBox("txtMobileNo", null, new { maxlength = "15", onkeyup = "validateMobile()", onpaste = "return false;" })
                                                    </tr>
                                                    @foreach (var item in Model.GroupList)
                                                    {
                                                        <tr>
                                                            <td></td>
                                                            <td colspan="1">&nbsp;&nbsp;&nbsp;@Html.CheckBox(item.GroupId.ToString(), false, new { id = item.GroupId, name = item.GroupName })@item.GroupName
                                                            </td>
                                                        </tr>
                                                    
                                                    }
                                                    <tr>
                                                        <td colspan="1"></td>
                                                        <td colspan="1">&nbsp;&nbsp;&nbsp;
                                                        <input type="submit" id="btnShare" name="Command" class="btnShare" value="Share" />
                                                            @if (!string.IsNullOrEmpty(Convert.ToString(TempData["Shared"])))
                                                            {                                                               
                                                                <script>
                                                                    alert('@Convert.ToString(TempData["Shared"])');                                                      
                                                                </script>                                                                
                                                            }
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <h1><a href="#">
                                    <div id="previous_solution_heading">Previous Solutions:</div>
                                </a></h1>
                                <div>
                                    @foreach (var item in Model.SolutionList)
                                    {
                                        if (!string.IsNullOrEmpty(item.Solution))
                                        {
                                        <div id="previous_solution_img1">
                                            <div id="previous_solution_text21">
                                                <table width="100%">
                                                    <tr>
                                                        <td style="width: 62%;">
                                                            @Html.Label("lblSolutions", item.Solution.ToString())
                                                        </td>
                                                        <td>
                                                            <div>PostedBy :<b> @item.reportedby</b></div>
                                                            <div>
                                                                Posted On:@item.SolutionDate<br />
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>


                                            </div>
                                        </div>
                                        <div id="previous_solution_space">
                                            <img src="~/Content/images/spacer.png" alt="" />
                                        </div>
                                        }
                                    }
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>   
    
}
